{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "def ToWeight(y):\n",
    "    w = np.zeros(y.shape, dtype=float)\n",
    "    print(w)\n",
    "    ind = y != 0\n",
    "    w[ind] = 1./(y[ind]**2)\n",
    "    print(w[ind])\n",
    "    return w\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0. 0. 0. 0.]\n",
      "[1.         0.25       0.11111111 0.0625    ]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([1.        , 0.25      , 0.11111111, 0.0625    ])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = np.array([1, 2, 3, 4])\n",
    "b = ToWeight(a)\n",
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "def rmspe(yhat, y):\n",
    "    w = ToWeight(y)\n",
    "    rmspe = np.sqrt(np.mean(w * (y - yhat) ** 2))\n",
    "    print(w*(y-yhat)**2)\n",
    "    print(np.mean(w * (y - yhat) ** 2))\n",
    "    print(rmspe)\n",
    "    return  rmspe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0. 0. 0. 0.]\n",
      "[1.         0.25       0.11111111 0.0625    ]\n",
      "[0.         0.25       0.44444444 0.5625    ]\n",
      "0.3142361111111111\n",
      "0.5605676686280713\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0.5605676686280713"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "yhat = np.array([1, 1, 1, 1])\n",
    "c = rmspe(yhat, a)\n",
    "c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = np.array([1, 2, 2, 3])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['2015-12-1', '2015-1-30', '2017-9-18']"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "date = ['2015-12-1', '2015-1-30', '2017-9-18']\n",
    "date"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2017-9-18'"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def month(x):\n",
    "    for x in date:\n",
    "        #x = x.split('-')[0]\n",
    "        lambda x: x.split('-')[0]\n",
    "    return x\n",
    "month(date)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "\n",
    "os.chdir('/Users/a1/Desktop/learning/kaggle_07/')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Store</th>\n",
       "      <th>StoreType</th>\n",
       "      <th>Assortment</th>\n",
       "      <th>CompetitionDistance</th>\n",
       "      <th>CompetitionOpenSinceMonth</th>\n",
       "      <th>CompetitionOpenSinceYear</th>\n",
       "      <th>Promo2</th>\n",
       "      <th>Promo2SinceWeek</th>\n",
       "      <th>Promo2SinceYear</th>\n",
       "      <th>PromoInterval</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>c</td>\n",
       "      <td>a</td>\n",
       "      <td>1270.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2008.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>570.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>1</td>\n",
       "      <td>13.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>14130.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>c</td>\n",
       "      <td>c</td>\n",
       "      <td>620.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>29910.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2015.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Store StoreType Assortment  CompetitionDistance  CompetitionOpenSinceMonth  \\\n",
       "0      1         c          a               1270.0                        9.0   \n",
       "1      2         a          a                570.0                       11.0   \n",
       "2      3         a          a              14130.0                       12.0   \n",
       "3      4         c          c                620.0                        9.0   \n",
       "4      5         a          a              29910.0                        4.0   \n",
       "\n",
       "   CompetitionOpenSinceYear  Promo2  Promo2SinceWeek  Promo2SinceYear  \\\n",
       "0                    2008.0       0              NaN              NaN   \n",
       "1                    2007.0       1             13.0           2010.0   \n",
       "2                    2006.0       1             14.0           2011.0   \n",
       "3                    2009.0       0              NaN              NaN   \n",
       "4                    2015.0       0              NaN              NaN   \n",
       "\n",
       "     PromoInterval  \n",
       "0              NaN  \n",
       "1  Jan,Apr,Jul,Oct  \n",
       "2  Jan,Apr,Jul,Oct  \n",
       "3              NaN  \n",
       "4              NaN  "
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "store = pd.read_csv('store.csv')\n",
    "store.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/a1/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2728: DtypeWarning: Columns (7) have mixed types. Specify dtype option on import or set low_memory=False.\n",
      "  interactivity=interactivity, compiler=compiler, result=result)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Store</th>\n",
       "      <th>DayOfWeek</th>\n",
       "      <th>Date</th>\n",
       "      <th>Sales</th>\n",
       "      <th>Customers</th>\n",
       "      <th>Open</th>\n",
       "      <th>Promo</th>\n",
       "      <th>StateHoliday</th>\n",
       "      <th>SchoolHoliday</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>5263</td>\n",
       "      <td>555</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>6064</td>\n",
       "      <td>625</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>8314</td>\n",
       "      <td>821</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>13995</td>\n",
       "      <td>1498</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>4822</td>\n",
       "      <td>559</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Store  DayOfWeek        Date  Sales  Customers  Open  Promo StateHoliday  \\\n",
       "0      1          5  2015-07-31   5263        555     1      1            0   \n",
       "1      2          5  2015-07-31   6064        625     1      1            0   \n",
       "2      3          5  2015-07-31   8314        821     1      1            0   \n",
       "3      4          5  2015-07-31  13995       1498     1      1            0   \n",
       "4      5          5  2015-07-31   4822        559     1      1            0   \n",
       "\n",
       "   SchoolHoliday  \n",
       "0              1  \n",
       "1              1  \n",
       "2              1  \n",
       "3              1  \n",
       "4              1  "
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_df = pd.read_csv('train.csv')\n",
    "train_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Store</th>\n",
       "      <th>DayOfWeek</th>\n",
       "      <th>Date</th>\n",
       "      <th>Open</th>\n",
       "      <th>Promo</th>\n",
       "      <th>StateHoliday</th>\n",
       "      <th>SchoolHoliday</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>8</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Id  Store  DayOfWeek        Date  Open  Promo StateHoliday  SchoolHoliday\n",
       "0   1      1          4  2015-09-17   1.0      1            0              0\n",
       "1   2      3          4  2015-09-17   1.0      1            0              0\n",
       "2   3      7          4  2015-09-17   1.0      1            0              0\n",
       "3   4      8          4  2015-09-17   1.0      1            0              0\n",
       "4   5      9          4  2015-09-17   1.0      1            0              0"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_df = pd.read_csv('test.csv')\n",
    "test_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "def load_data():\n",
    "    '''\n",
    "    加载数据，分为数值型与非数值型\n",
    "    '''\n",
    "    #导入store数据，\n",
    "    store = pd.read_csv('store.csv')\n",
    "    train_org = pd.read_csv('train.csv', dtype={'StateHoliday':pd.np.string_})\n",
    "    test_org = pd.read_csv('test.csv', dtype={'StateHoliday':pd.np.string_})\n",
    "    #合并数据作为train， test\n",
    "    train = pd.merge(train_org, store, on='Store', how='left')\n",
    "    test = pd.merge(test_org, store, on='Store', how = 'left')\n",
    "    #定义数值型特征和非数值型特征\n",
    "    features = test.columns.tolist() #把array格式转化为list格式\n",
    "    numerics = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64']\n",
    "    features_numeric = test.select_dtypes(include=numerics).columns.tolist()\n",
    "    features_non_numeric = [f for f in features if f not in features_numeric]\n",
    "    return (train, test, features, features_non_numeric)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Store</th>\n",
       "      <th>DayOfWeek</th>\n",
       "      <th>Date</th>\n",
       "      <th>Sales</th>\n",
       "      <th>Customers</th>\n",
       "      <th>Open</th>\n",
       "      <th>Promo</th>\n",
       "      <th>StateHoliday</th>\n",
       "      <th>SchoolHoliday</th>\n",
       "      <th>StoreType</th>\n",
       "      <th>Assortment</th>\n",
       "      <th>CompetitionDistance</th>\n",
       "      <th>CompetitionOpenSinceMonth</th>\n",
       "      <th>CompetitionOpenSinceYear</th>\n",
       "      <th>Promo2</th>\n",
       "      <th>Promo2SinceWeek</th>\n",
       "      <th>Promo2SinceYear</th>\n",
       "      <th>PromoInterval</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>5263</td>\n",
       "      <td>555</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>c</td>\n",
       "      <td>a</td>\n",
       "      <td>1270.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2008.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>6064</td>\n",
       "      <td>625</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>570.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>1</td>\n",
       "      <td>13.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>8314</td>\n",
       "      <td>821</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>14130.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>13995</td>\n",
       "      <td>1498</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>c</td>\n",
       "      <td>c</td>\n",
       "      <td>620.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>4822</td>\n",
       "      <td>559</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>29910.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2015.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>5651</td>\n",
       "      <td>589</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>310.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>15344</td>\n",
       "      <td>1414</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>24000.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>8492</td>\n",
       "      <td>833</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>7520.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>8565</td>\n",
       "      <td>687</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>2030.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>7185</td>\n",
       "      <td>681</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>3160.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>10457</td>\n",
       "      <td>1236</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>960.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>8959</td>\n",
       "      <td>962</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>1070.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>13.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>13</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>8821</td>\n",
       "      <td>568</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>310.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>45.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>14</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>6544</td>\n",
       "      <td>710</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>1300.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>15</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>9191</td>\n",
       "      <td>766</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>4110.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>16</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>10231</td>\n",
       "      <td>979</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>3270.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>17</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>8430</td>\n",
       "      <td>946</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>50.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>2005.0</td>\n",
       "      <td>1</td>\n",
       "      <td>26.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>18</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>10071</td>\n",
       "      <td>936</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>13840.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>19</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>8234</td>\n",
       "      <td>718</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>3240.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Mar,Jun,Sept,Dec</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>9593</td>\n",
       "      <td>974</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>2340.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>21</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>9515</td>\n",
       "      <td>682</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>c</td>\n",
       "      <td>c</td>\n",
       "      <td>550.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>1999.0</td>\n",
       "      <td>1</td>\n",
       "      <td>45.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>22</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>6566</td>\n",
       "      <td>633</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>1040.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>23</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>7273</td>\n",
       "      <td>560</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>4060.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>2005.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>24</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>14190</td>\n",
       "      <td>1082</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>4590.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>25</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>14180</td>\n",
       "      <td>1586</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>c</td>\n",
       "      <td>a</td>\n",
       "      <td>430.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2003.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>7818</td>\n",
       "      <td>611</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>2300.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>27</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>13213</td>\n",
       "      <td>1263</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>60.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2005.0</td>\n",
       "      <td>1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>28</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>7301</td>\n",
       "      <td>663</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>1200.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>1</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2015.0</td>\n",
       "      <td>Mar,Jun,Sept,Dec</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>29</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>9411</td>\n",
       "      <td>737</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>2170.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>30</td>\n",
       "      <td>5</td>\n",
       "      <td>2015-07-31</td>\n",
       "      <td>4776</td>\n",
       "      <td>625</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>1</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Mar,Jun,Sept,Dec</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017179</th>\n",
       "      <td>1086</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>180.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>1</td>\n",
       "      <td>18.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017180</th>\n",
       "      <td>1087</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>2210.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017181</th>\n",
       "      <td>1088</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>4300.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>1</td>\n",
       "      <td>27.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017182</th>\n",
       "      <td>1089</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>5220.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017183</th>\n",
       "      <td>1090</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>330.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017184</th>\n",
       "      <td>1091</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>9990.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017185</th>\n",
       "      <td>1092</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>300.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017186</th>\n",
       "      <td>1093</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>c</td>\n",
       "      <td>c</td>\n",
       "      <td>10450.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017187</th>\n",
       "      <td>1094</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>2380.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017188</th>\n",
       "      <td>1095</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>690.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017189</th>\n",
       "      <td>1096</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>1130.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Mar,Jun,Sept,Dec</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017190</th>\n",
       "      <td>1097</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>5961</td>\n",
       "      <td>1405</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>b</td>\n",
       "      <td>b</td>\n",
       "      <td>720.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2002.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017191</th>\n",
       "      <td>1098</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>1830.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2004.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017192</th>\n",
       "      <td>1099</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>200.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017193</th>\n",
       "      <td>1100</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>540.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017194</th>\n",
       "      <td>1101</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>4060.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017195</th>\n",
       "      <td>1102</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>850.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017196</th>\n",
       "      <td>1103</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>1340.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017197</th>\n",
       "      <td>1104</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>260.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017198</th>\n",
       "      <td>1105</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>c</td>\n",
       "      <td>c</td>\n",
       "      <td>330.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2008.0</td>\n",
       "      <td>1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017199</th>\n",
       "      <td>1106</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>5330.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>1</td>\n",
       "      <td>31.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017200</th>\n",
       "      <td>1107</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>1400.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>1</td>\n",
       "      <td>13.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017201</th>\n",
       "      <td>1108</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>540.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2004.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017202</th>\n",
       "      <td>1109</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>c</td>\n",
       "      <td>a</td>\n",
       "      <td>3490.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017203</th>\n",
       "      <td>1110</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>c</td>\n",
       "      <td>c</td>\n",
       "      <td>900.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017204</th>\n",
       "      <td>1111</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>1900.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>1</td>\n",
       "      <td>31.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017205</th>\n",
       "      <td>1112</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>c</td>\n",
       "      <td>c</td>\n",
       "      <td>1880.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017206</th>\n",
       "      <td>1113</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>9260.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017207</th>\n",
       "      <td>1114</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>870.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1017208</th>\n",
       "      <td>1115</td>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>5350.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>Mar,Jun,Sept,Dec</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1017209 rows × 18 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         Store  DayOfWeek        Date  Sales  Customers  Open  Promo  \\\n",
       "0            1          5  2015-07-31   5263        555     1      1   \n",
       "1            2          5  2015-07-31   6064        625     1      1   \n",
       "2            3          5  2015-07-31   8314        821     1      1   \n",
       "3            4          5  2015-07-31  13995       1498     1      1   \n",
       "4            5          5  2015-07-31   4822        559     1      1   \n",
       "5            6          5  2015-07-31   5651        589     1      1   \n",
       "6            7          5  2015-07-31  15344       1414     1      1   \n",
       "7            8          5  2015-07-31   8492        833     1      1   \n",
       "8            9          5  2015-07-31   8565        687     1      1   \n",
       "9           10          5  2015-07-31   7185        681     1      1   \n",
       "10          11          5  2015-07-31  10457       1236     1      1   \n",
       "11          12          5  2015-07-31   8959        962     1      1   \n",
       "12          13          5  2015-07-31   8821        568     1      1   \n",
       "13          14          5  2015-07-31   6544        710     1      1   \n",
       "14          15          5  2015-07-31   9191        766     1      1   \n",
       "15          16          5  2015-07-31  10231        979     1      1   \n",
       "16          17          5  2015-07-31   8430        946     1      1   \n",
       "17          18          5  2015-07-31  10071        936     1      1   \n",
       "18          19          5  2015-07-31   8234        718     1      1   \n",
       "19          20          5  2015-07-31   9593        974     1      1   \n",
       "20          21          5  2015-07-31   9515        682     1      1   \n",
       "21          22          5  2015-07-31   6566        633     1      1   \n",
       "22          23          5  2015-07-31   7273        560     1      1   \n",
       "23          24          5  2015-07-31  14190       1082     1      1   \n",
       "24          25          5  2015-07-31  14180       1586     1      1   \n",
       "25          26          5  2015-07-31   7818        611     1      1   \n",
       "26          27          5  2015-07-31  13213       1263     1      1   \n",
       "27          28          5  2015-07-31   7301        663     1      1   \n",
       "28          29          5  2015-07-31   9411        737     1      1   \n",
       "29          30          5  2015-07-31   4776        625     1      1   \n",
       "...        ...        ...         ...    ...        ...   ...    ...   \n",
       "1017179   1086          2  2013-01-01      0          0     0      0   \n",
       "1017180   1087          2  2013-01-01      0          0     0      0   \n",
       "1017181   1088          2  2013-01-01      0          0     0      0   \n",
       "1017182   1089          2  2013-01-01      0          0     0      0   \n",
       "1017183   1090          2  2013-01-01      0          0     0      0   \n",
       "1017184   1091          2  2013-01-01      0          0     0      0   \n",
       "1017185   1092          2  2013-01-01      0          0     0      0   \n",
       "1017186   1093          2  2013-01-01      0          0     0      0   \n",
       "1017187   1094          2  2013-01-01      0          0     0      0   \n",
       "1017188   1095          2  2013-01-01      0          0     0      0   \n",
       "1017189   1096          2  2013-01-01      0          0     0      0   \n",
       "1017190   1097          2  2013-01-01   5961       1405     1      0   \n",
       "1017191   1098          2  2013-01-01      0          0     0      0   \n",
       "1017192   1099          2  2013-01-01      0          0     0      0   \n",
       "1017193   1100          2  2013-01-01      0          0     0      0   \n",
       "1017194   1101          2  2013-01-01      0          0     0      0   \n",
       "1017195   1102          2  2013-01-01      0          0     0      0   \n",
       "1017196   1103          2  2013-01-01      0          0     0      0   \n",
       "1017197   1104          2  2013-01-01      0          0     0      0   \n",
       "1017198   1105          2  2013-01-01      0          0     0      0   \n",
       "1017199   1106          2  2013-01-01      0          0     0      0   \n",
       "1017200   1107          2  2013-01-01      0          0     0      0   \n",
       "1017201   1108          2  2013-01-01      0          0     0      0   \n",
       "1017202   1109          2  2013-01-01      0          0     0      0   \n",
       "1017203   1110          2  2013-01-01      0          0     0      0   \n",
       "1017204   1111          2  2013-01-01      0          0     0      0   \n",
       "1017205   1112          2  2013-01-01      0          0     0      0   \n",
       "1017206   1113          2  2013-01-01      0          0     0      0   \n",
       "1017207   1114          2  2013-01-01      0          0     0      0   \n",
       "1017208   1115          2  2013-01-01      0          0     0      0   \n",
       "\n",
       "        StateHoliday  SchoolHoliday StoreType Assortment  CompetitionDistance  \\\n",
       "0                  0              1         c          a               1270.0   \n",
       "1                  0              1         a          a                570.0   \n",
       "2                  0              1         a          a              14130.0   \n",
       "3                  0              1         c          c                620.0   \n",
       "4                  0              1         a          a              29910.0   \n",
       "5                  0              1         a          a                310.0   \n",
       "6                  0              1         a          c              24000.0   \n",
       "7                  0              1         a          a               7520.0   \n",
       "8                  0              1         a          c               2030.0   \n",
       "9                  0              1         a          a               3160.0   \n",
       "10                 0              1         a          c                960.0   \n",
       "11                 0              1         a          c               1070.0   \n",
       "12                 0              0         d          a                310.0   \n",
       "13                 0              1         a          a               1300.0   \n",
       "14                 0              1         d          c               4110.0   \n",
       "15                 0              1         a          c               3270.0   \n",
       "16                 0              1         a          a                 50.0   \n",
       "17                 0              1         d          c              13840.0   \n",
       "18                 0              1         a          c               3240.0   \n",
       "19                 0              0         d          a               2340.0   \n",
       "20                 0              1         c          c                550.0   \n",
       "21                 0              0         a          a               1040.0   \n",
       "22                 0              1         d          a               4060.0   \n",
       "23                 0              1         a          c               4590.0   \n",
       "24                 0              1         c          a                430.0   \n",
       "25                 0              1         d          a               2300.0   \n",
       "26                 0              1         a          a                 60.0   \n",
       "27                 0              1         a          a               1200.0   \n",
       "28                 0              1         d          c               2170.0   \n",
       "29                 0              1         a          a                 40.0   \n",
       "...              ...            ...       ...        ...                  ...   \n",
       "1017179            a              1         a          a                180.0   \n",
       "1017180            a              1         d          c               2210.0   \n",
       "1017181            a              1         a          a               4300.0   \n",
       "1017182            a              1         d          a               5220.0   \n",
       "1017183            a              1         a          a                330.0   \n",
       "1017184            a              1         a          c               9990.0   \n",
       "1017185            a              1         a          a                300.0   \n",
       "1017186            a              1         c          c              10450.0   \n",
       "1017187            a              1         d          a               2380.0   \n",
       "1017188            a              1         a          a                690.0   \n",
       "1017189            a              1         a          c               1130.0   \n",
       "1017190            a              1         b          b                720.0   \n",
       "1017191            a              1         a          a               1830.0   \n",
       "1017192            a              1         a          c                200.0   \n",
       "1017193            a              1         a          a                540.0   \n",
       "1017194            a              1         d          c               4060.0   \n",
       "1017195            a              1         a          a                850.0   \n",
       "1017196            a              1         d          c               1340.0   \n",
       "1017197            a              1         d          a                260.0   \n",
       "1017198            a              1         c          c                330.0   \n",
       "1017199            a              1         a          c               5330.0   \n",
       "1017200            a              1         a          a               1400.0   \n",
       "1017201            a              1         a          a                540.0   \n",
       "1017202            a              1         c          a               3490.0   \n",
       "1017203            a              1         c          c                900.0   \n",
       "1017204            a              1         a          a               1900.0   \n",
       "1017205            a              1         c          c               1880.0   \n",
       "1017206            a              1         a          c               9260.0   \n",
       "1017207            a              1         a          c                870.0   \n",
       "1017208            a              1         d          c               5350.0   \n",
       "\n",
       "         CompetitionOpenSinceMonth  CompetitionOpenSinceYear  Promo2  \\\n",
       "0                              9.0                    2008.0       0   \n",
       "1                             11.0                    2007.0       1   \n",
       "2                             12.0                    2006.0       1   \n",
       "3                              9.0                    2009.0       0   \n",
       "4                              4.0                    2015.0       0   \n",
       "5                             12.0                    2013.0       0   \n",
       "6                              4.0                    2013.0       0   \n",
       "7                             10.0                    2014.0       0   \n",
       "8                              8.0                    2000.0       0   \n",
       "9                              9.0                    2009.0       0   \n",
       "10                            11.0                    2011.0       1   \n",
       "11                             NaN                       NaN       1   \n",
       "12                             NaN                       NaN       1   \n",
       "13                             3.0                    2014.0       1   \n",
       "14                             3.0                    2010.0       1   \n",
       "15                             NaN                       NaN       0   \n",
       "16                            12.0                    2005.0       1   \n",
       "17                             6.0                    2010.0       1   \n",
       "18                             NaN                       NaN       1   \n",
       "19                             5.0                    2009.0       1   \n",
       "20                            10.0                    1999.0       1   \n",
       "21                             NaN                       NaN       1   \n",
       "22                             8.0                    2005.0       0   \n",
       "23                             3.0                    2000.0       1   \n",
       "24                             4.0                    2003.0       0   \n",
       "25                             NaN                       NaN       0   \n",
       "26                             1.0                    2005.0       1   \n",
       "27                            10.0                    2014.0       1   \n",
       "28                             NaN                       NaN       0   \n",
       "29                             2.0                    2014.0       1   \n",
       "...                            ...                       ...     ...   \n",
       "1017179                       11.0                    2013.0       1   \n",
       "1017180                       11.0                    2011.0       0   \n",
       "1017181                        3.0                    2009.0       1   \n",
       "1017182                        5.0                    2009.0       0   \n",
       "1017183                        NaN                       NaN       1   \n",
       "1017184                        NaN                       NaN       0   \n",
       "1017185                        7.0                    2000.0       1   \n",
       "1017186                        6.0                    2009.0       0   \n",
       "1017187                        3.0                    2013.0       1   \n",
       "1017188                        6.0                    2007.0       1   \n",
       "1017189                        NaN                       NaN       1   \n",
       "1017190                        3.0                    2002.0       0   \n",
       "1017191                       11.0                    2004.0       0   \n",
       "1017192                        4.0                    2013.0       1   \n",
       "1017193                        NaN                       NaN       1   \n",
       "1017194                        9.0                    2012.0       0   \n",
       "1017195                       11.0                    2012.0       1   \n",
       "1017196                       10.0                    2006.0       1   \n",
       "1017197                        2.0                    2012.0       1   \n",
       "1017198                       11.0                    2008.0       1   \n",
       "1017199                        9.0                    2011.0       1   \n",
       "1017200                        6.0                    2012.0       1   \n",
       "1017201                        4.0                    2004.0       0   \n",
       "1017202                        4.0                    2011.0       1   \n",
       "1017203                        9.0                    2010.0       0   \n",
       "1017204                        6.0                    2014.0       1   \n",
       "1017205                        4.0                    2006.0       0   \n",
       "1017206                        NaN                       NaN       0   \n",
       "1017207                        NaN                       NaN       0   \n",
       "1017208                        NaN                       NaN       1   \n",
       "\n",
       "         Promo2SinceWeek  Promo2SinceYear     PromoInterval  \n",
       "0                    NaN              NaN               NaN  \n",
       "1                   13.0           2010.0   Jan,Apr,Jul,Oct  \n",
       "2                   14.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "3                    NaN              NaN               NaN  \n",
       "4                    NaN              NaN               NaN  \n",
       "5                    NaN              NaN               NaN  \n",
       "6                    NaN              NaN               NaN  \n",
       "7                    NaN              NaN               NaN  \n",
       "8                    NaN              NaN               NaN  \n",
       "9                    NaN              NaN               NaN  \n",
       "10                   1.0           2012.0   Jan,Apr,Jul,Oct  \n",
       "11                  13.0           2010.0   Jan,Apr,Jul,Oct  \n",
       "12                  45.0           2009.0   Feb,May,Aug,Nov  \n",
       "13                  40.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "14                  14.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "15                   NaN              NaN               NaN  \n",
       "16                  26.0           2010.0   Jan,Apr,Jul,Oct  \n",
       "17                  14.0           2012.0   Jan,Apr,Jul,Oct  \n",
       "18                  22.0           2011.0  Mar,Jun,Sept,Dec  \n",
       "19                  40.0           2014.0   Jan,Apr,Jul,Oct  \n",
       "20                  45.0           2009.0   Jan,Apr,Jul,Oct  \n",
       "21                  22.0           2012.0   Jan,Apr,Jul,Oct  \n",
       "22                   NaN              NaN               NaN  \n",
       "23                  40.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "24                   NaN              NaN               NaN  \n",
       "25                   NaN              NaN               NaN  \n",
       "26                   5.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "27                   6.0           2015.0  Mar,Jun,Sept,Dec  \n",
       "28                   NaN              NaN               NaN  \n",
       "29                  10.0           2014.0  Mar,Jun,Sept,Dec  \n",
       "...                  ...              ...               ...  \n",
       "1017179             18.0           2011.0   Feb,May,Aug,Nov  \n",
       "1017180              NaN              NaN               NaN  \n",
       "1017181             27.0           2013.0   Jan,Apr,Jul,Oct  \n",
       "1017182              NaN              NaN               NaN  \n",
       "1017183             14.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "1017184              NaN              NaN               NaN  \n",
       "1017185             40.0           2014.0   Jan,Apr,Jul,Oct  \n",
       "1017186              NaN              NaN               NaN  \n",
       "1017187             40.0           2014.0   Jan,Apr,Jul,Oct  \n",
       "1017188             14.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "1017189             10.0           2014.0  Mar,Jun,Sept,Dec  \n",
       "1017190              NaN              NaN               NaN  \n",
       "1017191              NaN              NaN               NaN  \n",
       "1017192             14.0           2013.0   Jan,Apr,Jul,Oct  \n",
       "1017193             14.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "1017194              NaN              NaN               NaN  \n",
       "1017195             40.0           2014.0   Jan,Apr,Jul,Oct  \n",
       "1017196              5.0           2013.0   Feb,May,Aug,Nov  \n",
       "1017197             14.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "1017198              5.0           2013.0   Feb,May,Aug,Nov  \n",
       "1017199             31.0           2013.0   Jan,Apr,Jul,Oct  \n",
       "1017200             13.0           2010.0   Jan,Apr,Jul,Oct  \n",
       "1017201              NaN              NaN               NaN  \n",
       "1017202             22.0           2012.0   Jan,Apr,Jul,Oct  \n",
       "1017203              NaN              NaN               NaN  \n",
       "1017204             31.0           2013.0   Jan,Apr,Jul,Oct  \n",
       "1017205              NaN              NaN               NaN  \n",
       "1017206              NaN              NaN               NaN  \n",
       "1017207              NaN              NaN               NaN  \n",
       "1017208             22.0           2012.0  Mar,Jun,Sept,Dec  \n",
       "\n",
       "[1017209 rows x 18 columns]"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "store = pd.read_csv('store.csv')\n",
    "train_org = pd.read_csv('train.csv', dtype={'StateHoliday':pd.np.string_})\n",
    "test_org = pd.read_csv('test.csv', dtype={'StateHoliday':pd.np.string_})\n",
    "   \n",
    "train = pd.merge(train_org, store, on='Store', how='left')\n",
    "train"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Store</th>\n",
       "      <th>DayOfWeek</th>\n",
       "      <th>Date</th>\n",
       "      <th>Open</th>\n",
       "      <th>Promo</th>\n",
       "      <th>StateHoliday</th>\n",
       "      <th>SchoolHoliday</th>\n",
       "      <th>StoreType</th>\n",
       "      <th>Assortment</th>\n",
       "      <th>CompetitionDistance</th>\n",
       "      <th>CompetitionOpenSinceMonth</th>\n",
       "      <th>CompetitionOpenSinceYear</th>\n",
       "      <th>Promo2</th>\n",
       "      <th>Promo2SinceWeek</th>\n",
       "      <th>Promo2SinceYear</th>\n",
       "      <th>PromoInterval</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>c</td>\n",
       "      <td>a</td>\n",
       "      <td>1270.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2008.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>14130.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>24000.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>8</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>7520.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>2030.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>10</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>3160.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>11</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>960.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>12</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>1070.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>13.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>13</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>310.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>45.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>14</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>1300.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>15</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>4110.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>16</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>3270.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>13</td>\n",
       "      <td>19</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>3240.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Mar,Jun,Sept,Dec</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>14</td>\n",
       "      <td>20</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>2340.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>15</td>\n",
       "      <td>21</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>c</td>\n",
       "      <td>c</td>\n",
       "      <td>550.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>1999.0</td>\n",
       "      <td>1</td>\n",
       "      <td>45.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>16</td>\n",
       "      <td>22</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>1040.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>17</td>\n",
       "      <td>23</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>4060.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>2005.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>18</td>\n",
       "      <td>24</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>4590.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>19</td>\n",
       "      <td>25</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>c</td>\n",
       "      <td>a</td>\n",
       "      <td>430.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2003.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20</td>\n",
       "      <td>27</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>60.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2005.0</td>\n",
       "      <td>1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>21</td>\n",
       "      <td>29</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>2170.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>22</td>\n",
       "      <td>30</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>1</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Mar,Jun,Sept,Dec</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>23</td>\n",
       "      <td>31</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>9800.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>24</td>\n",
       "      <td>32</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>2910.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>45.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>25</td>\n",
       "      <td>33</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>1320.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>26</td>\n",
       "      <td>35</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>7660.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>27</td>\n",
       "      <td>36</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>540.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2003.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>28</td>\n",
       "      <td>38</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>1090.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>29</td>\n",
       "      <td>39</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>260.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>1</td>\n",
       "      <td>31.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>30</td>\n",
       "      <td>40</td>\n",
       "      <td>4</td>\n",
       "      <td>2015-09-17</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>180.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>45.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41058</th>\n",
       "      <td>41059</td>\n",
       "      <td>1077</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>3750.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2001.0</td>\n",
       "      <td>1</td>\n",
       "      <td>35.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>Mar,Jun,Sept,Dec</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41059</th>\n",
       "      <td>41060</td>\n",
       "      <td>1078</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>670.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41060</th>\n",
       "      <td>41061</td>\n",
       "      <td>1079</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>16680.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>37.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41061</th>\n",
       "      <td>41062</td>\n",
       "      <td>1080</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>2410.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41062</th>\n",
       "      <td>41063</td>\n",
       "      <td>1083</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>11540.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41063</th>\n",
       "      <td>41064</td>\n",
       "      <td>1084</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>190.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>13.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41064</th>\n",
       "      <td>41065</td>\n",
       "      <td>1086</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>180.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>1</td>\n",
       "      <td>18.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41065</th>\n",
       "      <td>41066</td>\n",
       "      <td>1087</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>2210.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41066</th>\n",
       "      <td>41067</td>\n",
       "      <td>1088</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>4300.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>1</td>\n",
       "      <td>27.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41067</th>\n",
       "      <td>41068</td>\n",
       "      <td>1089</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>5220.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41068</th>\n",
       "      <td>41069</td>\n",
       "      <td>1091</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>9990.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41069</th>\n",
       "      <td>41070</td>\n",
       "      <td>1092</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>300.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41070</th>\n",
       "      <td>41071</td>\n",
       "      <td>1094</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>2380.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41071</th>\n",
       "      <td>41072</td>\n",
       "      <td>1096</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>1130.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Mar,Jun,Sept,Dec</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41072</th>\n",
       "      <td>41073</td>\n",
       "      <td>1097</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>b</td>\n",
       "      <td>b</td>\n",
       "      <td>720.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2002.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41073</th>\n",
       "      <td>41074</td>\n",
       "      <td>1099</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>200.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41074</th>\n",
       "      <td>41075</td>\n",
       "      <td>1100</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>540.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41075</th>\n",
       "      <td>41076</td>\n",
       "      <td>1101</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>4060.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41076</th>\n",
       "      <td>41077</td>\n",
       "      <td>1102</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>850.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41077</th>\n",
       "      <td>41078</td>\n",
       "      <td>1103</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>1340.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41078</th>\n",
       "      <td>41079</td>\n",
       "      <td>1104</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>260.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41079</th>\n",
       "      <td>41080</td>\n",
       "      <td>1105</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>c</td>\n",
       "      <td>c</td>\n",
       "      <td>330.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>2008.0</td>\n",
       "      <td>1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41080</th>\n",
       "      <td>41081</td>\n",
       "      <td>1106</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>5330.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>1</td>\n",
       "      <td>31.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41081</th>\n",
       "      <td>41082</td>\n",
       "      <td>1107</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>1400.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>1</td>\n",
       "      <td>13.0</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41082</th>\n",
       "      <td>41083</td>\n",
       "      <td>1109</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>c</td>\n",
       "      <td>a</td>\n",
       "      <td>3490.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41083</th>\n",
       "      <td>41084</td>\n",
       "      <td>1111</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>1900.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>1</td>\n",
       "      <td>31.0</td>\n",
       "      <td>2013.0</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41084</th>\n",
       "      <td>41085</td>\n",
       "      <td>1112</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>c</td>\n",
       "      <td>c</td>\n",
       "      <td>1880.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41085</th>\n",
       "      <td>41086</td>\n",
       "      <td>1113</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>9260.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41086</th>\n",
       "      <td>41087</td>\n",
       "      <td>1114</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>870.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41087</th>\n",
       "      <td>41088</td>\n",
       "      <td>1115</td>\n",
       "      <td>6</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>5350.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>Mar,Jun,Sept,Dec</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>41088 rows × 17 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          Id  Store  DayOfWeek        Date  Open  Promo StateHoliday  \\\n",
       "0          1      1          4  2015-09-17   1.0      1            0   \n",
       "1          2      3          4  2015-09-17   1.0      1            0   \n",
       "2          3      7          4  2015-09-17   1.0      1            0   \n",
       "3          4      8          4  2015-09-17   1.0      1            0   \n",
       "4          5      9          4  2015-09-17   1.0      1            0   \n",
       "5          6     10          4  2015-09-17   1.0      1            0   \n",
       "6          7     11          4  2015-09-17   1.0      1            0   \n",
       "7          8     12          4  2015-09-17   1.0      1            0   \n",
       "8          9     13          4  2015-09-17   1.0      1            0   \n",
       "9         10     14          4  2015-09-17   1.0      1            0   \n",
       "10        11     15          4  2015-09-17   1.0      1            0   \n",
       "11        12     16          4  2015-09-17   1.0      1            0   \n",
       "12        13     19          4  2015-09-17   1.0      1            0   \n",
       "13        14     20          4  2015-09-17   1.0      1            0   \n",
       "14        15     21          4  2015-09-17   1.0      1            0   \n",
       "15        16     22          4  2015-09-17   1.0      1            0   \n",
       "16        17     23          4  2015-09-17   1.0      1            0   \n",
       "17        18     24          4  2015-09-17   1.0      1            0   \n",
       "18        19     25          4  2015-09-17   1.0      1            0   \n",
       "19        20     27          4  2015-09-17   1.0      1            0   \n",
       "20        21     29          4  2015-09-17   1.0      1            0   \n",
       "21        22     30          4  2015-09-17   1.0      1            0   \n",
       "22        23     31          4  2015-09-17   1.0      1            0   \n",
       "23        24     32          4  2015-09-17   1.0      1            0   \n",
       "24        25     33          4  2015-09-17   1.0      1            0   \n",
       "25        26     35          4  2015-09-17   1.0      1            0   \n",
       "26        27     36          4  2015-09-17   1.0      1            0   \n",
       "27        28     38          4  2015-09-17   1.0      1            0   \n",
       "28        29     39          4  2015-09-17   1.0      1            0   \n",
       "29        30     40          4  2015-09-17   1.0      1            0   \n",
       "...      ...    ...        ...         ...   ...    ...          ...   \n",
       "41058  41059   1077          6  2015-08-01   1.0      0            0   \n",
       "41059  41060   1078          6  2015-08-01   1.0      0            0   \n",
       "41060  41061   1079          6  2015-08-01   1.0      0            0   \n",
       "41061  41062   1080          6  2015-08-01   1.0      0            0   \n",
       "41062  41063   1083          6  2015-08-01   1.0      0            0   \n",
       "41063  41064   1084          6  2015-08-01   1.0      0            0   \n",
       "41064  41065   1086          6  2015-08-01   1.0      0            0   \n",
       "41065  41066   1087          6  2015-08-01   1.0      0            0   \n",
       "41066  41067   1088          6  2015-08-01   1.0      0            0   \n",
       "41067  41068   1089          6  2015-08-01   1.0      0            0   \n",
       "41068  41069   1091          6  2015-08-01   1.0      0            0   \n",
       "41069  41070   1092          6  2015-08-01   1.0      0            0   \n",
       "41070  41071   1094          6  2015-08-01   1.0      0            0   \n",
       "41071  41072   1096          6  2015-08-01   1.0      0            0   \n",
       "41072  41073   1097          6  2015-08-01   1.0      0            0   \n",
       "41073  41074   1099          6  2015-08-01   1.0      0            0   \n",
       "41074  41075   1100          6  2015-08-01   1.0      0            0   \n",
       "41075  41076   1101          6  2015-08-01   1.0      0            0   \n",
       "41076  41077   1102          6  2015-08-01   1.0      0            0   \n",
       "41077  41078   1103          6  2015-08-01   1.0      0            0   \n",
       "41078  41079   1104          6  2015-08-01   1.0      0            0   \n",
       "41079  41080   1105          6  2015-08-01   1.0      0            0   \n",
       "41080  41081   1106          6  2015-08-01   1.0      0            0   \n",
       "41081  41082   1107          6  2015-08-01   1.0      0            0   \n",
       "41082  41083   1109          6  2015-08-01   1.0      0            0   \n",
       "41083  41084   1111          6  2015-08-01   1.0      0            0   \n",
       "41084  41085   1112          6  2015-08-01   1.0      0            0   \n",
       "41085  41086   1113          6  2015-08-01   1.0      0            0   \n",
       "41086  41087   1114          6  2015-08-01   1.0      0            0   \n",
       "41087  41088   1115          6  2015-08-01   1.0      0            0   \n",
       "\n",
       "       SchoolHoliday StoreType Assortment  CompetitionDistance  \\\n",
       "0                  0         c          a               1270.0   \n",
       "1                  0         a          a              14130.0   \n",
       "2                  0         a          c              24000.0   \n",
       "3                  0         a          a               7520.0   \n",
       "4                  0         a          c               2030.0   \n",
       "5                  0         a          a               3160.0   \n",
       "6                  0         a          c                960.0   \n",
       "7                  0         a          c               1070.0   \n",
       "8                  0         d          a                310.0   \n",
       "9                  0         a          a               1300.0   \n",
       "10                 0         d          c               4110.0   \n",
       "11                 0         a          c               3270.0   \n",
       "12                 0         a          c               3240.0   \n",
       "13                 0         d          a               2340.0   \n",
       "14                 0         c          c                550.0   \n",
       "15                 0         a          a               1040.0   \n",
       "16                 0         d          a               4060.0   \n",
       "17                 0         a          c               4590.0   \n",
       "18                 0         c          a                430.0   \n",
       "19                 0         a          a                 60.0   \n",
       "20                 0         d          c               2170.0   \n",
       "21                 0         a          a                 40.0   \n",
       "22                 0         d          c               9800.0   \n",
       "23                 0         a          a               2910.0   \n",
       "24                 0         a          c               1320.0   \n",
       "25                 0         d          c               7660.0   \n",
       "26                 0         a          c                540.0   \n",
       "27                 0         d          a               1090.0   \n",
       "28                 0         a          a                260.0   \n",
       "29                 0         a          a                180.0   \n",
       "...              ...       ...        ...                  ...   \n",
       "41058              0         a          a               3750.0   \n",
       "41059              0         d          c                670.0   \n",
       "41060              1         a          a              16680.0   \n",
       "41061              0         a          a               2410.0   \n",
       "41062              1         d          c              11540.0   \n",
       "41063              1         a          a                190.0   \n",
       "41064              1         a          a                180.0   \n",
       "41065              1         d          c               2210.0   \n",
       "41066              0         a          a               4300.0   \n",
       "41067              0         d          a               5220.0   \n",
       "41068              0         a          c               9990.0   \n",
       "41069              0         a          a                300.0   \n",
       "41070              0         d          a               2380.0   \n",
       "41071              0         a          c               1130.0   \n",
       "41072              0         b          b                720.0   \n",
       "41073              0         a          c                200.0   \n",
       "41074              0         a          a                540.0   \n",
       "41075              0         d          c               4060.0   \n",
       "41076              0         a          a                850.0   \n",
       "41077              1         d          c               1340.0   \n",
       "41078              0         d          a                260.0   \n",
       "41079              0         c          c                330.0   \n",
       "41080              0         a          c               5330.0   \n",
       "41081              0         a          a               1400.0   \n",
       "41082              0         c          a               3490.0   \n",
       "41083              0         a          a               1900.0   \n",
       "41084              0         c          c               1880.0   \n",
       "41085              0         a          c               9260.0   \n",
       "41086              0         a          c                870.0   \n",
       "41087              1         d          c               5350.0   \n",
       "\n",
       "       CompetitionOpenSinceMonth  CompetitionOpenSinceYear  Promo2  \\\n",
       "0                            9.0                    2008.0       0   \n",
       "1                           12.0                    2006.0       1   \n",
       "2                            4.0                    2013.0       0   \n",
       "3                           10.0                    2014.0       0   \n",
       "4                            8.0                    2000.0       0   \n",
       "5                            9.0                    2009.0       0   \n",
       "6                           11.0                    2011.0       1   \n",
       "7                            NaN                       NaN       1   \n",
       "8                            NaN                       NaN       1   \n",
       "9                            3.0                    2014.0       1   \n",
       "10                           3.0                    2010.0       1   \n",
       "11                           NaN                       NaN       0   \n",
       "12                           NaN                       NaN       1   \n",
       "13                           5.0                    2009.0       1   \n",
       "14                          10.0                    1999.0       1   \n",
       "15                           NaN                       NaN       1   \n",
       "16                           8.0                    2005.0       0   \n",
       "17                           3.0                    2000.0       1   \n",
       "18                           4.0                    2003.0       0   \n",
       "19                           1.0                    2005.0       1   \n",
       "20                           NaN                       NaN       0   \n",
       "21                           2.0                    2014.0       1   \n",
       "22                           7.0                    2012.0       0   \n",
       "23                           NaN                       NaN       1   \n",
       "24                           5.0                    2013.0       0   \n",
       "25                          10.0                    2000.0       1   \n",
       "26                           6.0                    2003.0       1   \n",
       "27                           4.0                    2007.0       0   \n",
       "28                          10.0                    2006.0       1   \n",
       "29                           NaN                       NaN       1   \n",
       "...                          ...                       ...     ...   \n",
       "41058                       11.0                    2001.0       1   \n",
       "41059                        NaN                       NaN       1   \n",
       "41060                        NaN                       NaN       1   \n",
       "41061                        NaN                       NaN       1   \n",
       "41062                        NaN                       NaN       1   \n",
       "41063                        NaN                       NaN       1   \n",
       "41064                       11.0                    2013.0       1   \n",
       "41065                       11.0                    2011.0       0   \n",
       "41066                        3.0                    2009.0       1   \n",
       "41067                        5.0                    2009.0       0   \n",
       "41068                        NaN                       NaN       0   \n",
       "41069                        7.0                    2000.0       1   \n",
       "41070                        3.0                    2013.0       1   \n",
       "41071                        NaN                       NaN       1   \n",
       "41072                        3.0                    2002.0       0   \n",
       "41073                        4.0                    2013.0       1   \n",
       "41074                        NaN                       NaN       1   \n",
       "41075                        9.0                    2012.0       0   \n",
       "41076                       11.0                    2012.0       1   \n",
       "41077                       10.0                    2006.0       1   \n",
       "41078                        2.0                    2012.0       1   \n",
       "41079                       11.0                    2008.0       1   \n",
       "41080                        9.0                    2011.0       1   \n",
       "41081                        6.0                    2012.0       1   \n",
       "41082                        4.0                    2011.0       1   \n",
       "41083                        6.0                    2014.0       1   \n",
       "41084                        4.0                    2006.0       0   \n",
       "41085                        NaN                       NaN       0   \n",
       "41086                        NaN                       NaN       0   \n",
       "41087                        NaN                       NaN       1   \n",
       "\n",
       "       Promo2SinceWeek  Promo2SinceYear     PromoInterval  \n",
       "0                  NaN              NaN               NaN  \n",
       "1                 14.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "2                  NaN              NaN               NaN  \n",
       "3                  NaN              NaN               NaN  \n",
       "4                  NaN              NaN               NaN  \n",
       "5                  NaN              NaN               NaN  \n",
       "6                  1.0           2012.0   Jan,Apr,Jul,Oct  \n",
       "7                 13.0           2010.0   Jan,Apr,Jul,Oct  \n",
       "8                 45.0           2009.0   Feb,May,Aug,Nov  \n",
       "9                 40.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "10                14.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "11                 NaN              NaN               NaN  \n",
       "12                22.0           2011.0  Mar,Jun,Sept,Dec  \n",
       "13                40.0           2014.0   Jan,Apr,Jul,Oct  \n",
       "14                45.0           2009.0   Jan,Apr,Jul,Oct  \n",
       "15                22.0           2012.0   Jan,Apr,Jul,Oct  \n",
       "16                 NaN              NaN               NaN  \n",
       "17                40.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "18                 NaN              NaN               NaN  \n",
       "19                 5.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "20                 NaN              NaN               NaN  \n",
       "21                10.0           2014.0  Mar,Jun,Sept,Dec  \n",
       "22                 NaN              NaN               NaN  \n",
       "23                45.0           2009.0   Feb,May,Aug,Nov  \n",
       "24                 NaN              NaN               NaN  \n",
       "25                 1.0           2012.0   Jan,Apr,Jul,Oct  \n",
       "26                40.0           2014.0   Jan,Apr,Jul,Oct  \n",
       "27                 NaN              NaN               NaN  \n",
       "28                31.0           2013.0   Feb,May,Aug,Nov  \n",
       "29                45.0           2009.0   Feb,May,Aug,Nov  \n",
       "...                ...              ...               ...  \n",
       "41058             35.0           2010.0  Mar,Jun,Sept,Dec  \n",
       "41059             40.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "41060             37.0           2009.0   Jan,Apr,Jul,Oct  \n",
       "41061             40.0           2014.0   Jan,Apr,Jul,Oct  \n",
       "41062              5.0           2013.0   Feb,May,Aug,Nov  \n",
       "41063             13.0           2010.0   Jan,Apr,Jul,Oct  \n",
       "41064             18.0           2011.0   Feb,May,Aug,Nov  \n",
       "41065              NaN              NaN               NaN  \n",
       "41066             27.0           2013.0   Jan,Apr,Jul,Oct  \n",
       "41067              NaN              NaN               NaN  \n",
       "41068              NaN              NaN               NaN  \n",
       "41069             40.0           2014.0   Jan,Apr,Jul,Oct  \n",
       "41070             40.0           2014.0   Jan,Apr,Jul,Oct  \n",
       "41071             10.0           2014.0  Mar,Jun,Sept,Dec  \n",
       "41072              NaN              NaN               NaN  \n",
       "41073             14.0           2013.0   Jan,Apr,Jul,Oct  \n",
       "41074             14.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "41075              NaN              NaN               NaN  \n",
       "41076             40.0           2014.0   Jan,Apr,Jul,Oct  \n",
       "41077              5.0           2013.0   Feb,May,Aug,Nov  \n",
       "41078             14.0           2011.0   Jan,Apr,Jul,Oct  \n",
       "41079              5.0           2013.0   Feb,May,Aug,Nov  \n",
       "41080             31.0           2013.0   Jan,Apr,Jul,Oct  \n",
       "41081             13.0           2010.0   Jan,Apr,Jul,Oct  \n",
       "41082             22.0           2012.0   Jan,Apr,Jul,Oct  \n",
       "41083             31.0           2013.0   Jan,Apr,Jul,Oct  \n",
       "41084              NaN              NaN               NaN  \n",
       "41085              NaN              NaN               NaN  \n",
       "41086              NaN              NaN               NaN  \n",
       "41087             22.0           2012.0  Mar,Jun,Sept,Dec  \n",
       "\n",
       "[41088 rows x 17 columns]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test = pd.merge(test_org, store, on='Store', how = 'left')\n",
    "test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1017209\n",
      "41088\n",
      "2\n"
     ]
    }
   ],
   "source": [
    "# for year in [train,test]:\n",
    "#     train['year'] = data.Date.apply(lambda x: x.split('-')[0])\n",
    "#     data['year'] = data['year'].astype(float)\n",
    "# return data['year']\n",
    "a = [train, test]\n",
    "print(len(train))\n",
    "print(len(test))\n",
    "print(len(a))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0                       NaN\n",
       "1           Jan,Apr,Jul,Oct\n",
       "2           Jan,Apr,Jul,Oct\n",
       "3                       NaN\n",
       "4                       NaN\n",
       "5                       NaN\n",
       "6                       NaN\n",
       "7                       NaN\n",
       "8                       NaN\n",
       "9                       NaN\n",
       "10          Jan,Apr,Jul,Oct\n",
       "11          Jan,Apr,Jul,Oct\n",
       "12          Feb,May,Aug,Nov\n",
       "13          Jan,Apr,Jul,Oct\n",
       "14          Jan,Apr,Jul,Oct\n",
       "15                      NaN\n",
       "16          Jan,Apr,Jul,Oct\n",
       "17          Jan,Apr,Jul,Oct\n",
       "18         Mar,Jun,Sept,Dec\n",
       "19          Jan,Apr,Jul,Oct\n",
       "20          Jan,Apr,Jul,Oct\n",
       "21          Jan,Apr,Jul,Oct\n",
       "22                      NaN\n",
       "23          Jan,Apr,Jul,Oct\n",
       "24                      NaN\n",
       "25                      NaN\n",
       "26          Jan,Apr,Jul,Oct\n",
       "27         Mar,Jun,Sept,Dec\n",
       "28                      NaN\n",
       "29         Mar,Jun,Sept,Dec\n",
       "                 ...       \n",
       "1017179     Feb,May,Aug,Nov\n",
       "1017180                 NaN\n",
       "1017181     Jan,Apr,Jul,Oct\n",
       "1017182                 NaN\n",
       "1017183     Jan,Apr,Jul,Oct\n",
       "1017184                 NaN\n",
       "1017185     Jan,Apr,Jul,Oct\n",
       "1017186                 NaN\n",
       "1017187     Jan,Apr,Jul,Oct\n",
       "1017188     Jan,Apr,Jul,Oct\n",
       "1017189    Mar,Jun,Sept,Dec\n",
       "1017190                 NaN\n",
       "1017191                 NaN\n",
       "1017192     Jan,Apr,Jul,Oct\n",
       "1017193     Jan,Apr,Jul,Oct\n",
       "1017194                 NaN\n",
       "1017195     Jan,Apr,Jul,Oct\n",
       "1017196     Feb,May,Aug,Nov\n",
       "1017197     Jan,Apr,Jul,Oct\n",
       "1017198     Feb,May,Aug,Nov\n",
       "1017199     Jan,Apr,Jul,Oct\n",
       "1017200     Jan,Apr,Jul,Oct\n",
       "1017201                 NaN\n",
       "1017202     Jan,Apr,Jul,Oct\n",
       "1017203                 NaN\n",
       "1017204     Jan,Apr,Jul,Oct\n",
       "1017205                 NaN\n",
       "1017206                 NaN\n",
       "1017207                 NaN\n",
       "1017208    Mar,Jun,Sept,Dec\n",
       "Name: PromoInterval, Length: 1017209, dtype: object"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1 = train.PromoInterval\n",
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0          0\n",
       "1          1\n",
       "2          1\n",
       "3          0\n",
       "4          0\n",
       "5          0\n",
       "6          0\n",
       "7          0\n",
       "8          0\n",
       "9          0\n",
       "10         1\n",
       "11         1\n",
       "12         0\n",
       "13         1\n",
       "14         1\n",
       "15         0\n",
       "16         1\n",
       "17         1\n",
       "18         0\n",
       "19         1\n",
       "20         1\n",
       "21         1\n",
       "22         0\n",
       "23         1\n",
       "24         0\n",
       "25         0\n",
       "26         1\n",
       "27         0\n",
       "28         0\n",
       "29         0\n",
       "          ..\n",
       "1017179    0\n",
       "1017180    0\n",
       "1017181    1\n",
       "1017182    0\n",
       "1017183    1\n",
       "1017184    0\n",
       "1017185    1\n",
       "1017186    0\n",
       "1017187    1\n",
       "1017188    1\n",
       "1017189    0\n",
       "1017190    0\n",
       "1017191    0\n",
       "1017192    1\n",
       "1017193    1\n",
       "1017194    0\n",
       "1017195    1\n",
       "1017196    0\n",
       "1017197    1\n",
       "1017198    0\n",
       "1017199    1\n",
       "1017200    1\n",
       "1017201    0\n",
       "1017202    1\n",
       "1017203    0\n",
       "1017204    1\n",
       "1017205    0\n",
       "1017206    0\n",
       "1017207    0\n",
       "1017208    0\n",
       "Name: PromoInterval, Length: 1017209, dtype: int64"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1.apply(lambda x: 0 if isinstance(x, float) else 1 if \"Jan\" in x else 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'myid' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-79-87d509afc653>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mnoisy_features\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mmyid\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'Date'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m: name 'myid' is not defined"
     ]
    }
   ],
   "source": [
    "noisy_features = [myid,'Date']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Running with params: hah\n"
     ]
    }
   ],
   "source": [
    "params = 'hah'\n",
    "print(\"Running with params: \" + str(params))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
